package com.tcm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tcm.entity.SubjectItem;
import com.tcm.entity.bo.SubjectItemExcel;
import com.tcm.entity.dto.param.SubjectItemPageParam;
import com.tcm.entity.dto.SubjectItemUpdateDto;
import com.tcm.entity.vo.BatchImportResult;
import com.tcm.entity.resp.PageR;
import com.tcm.entity.vo.SubjectItemListResult;
import com.tcm.exception.DatabaseOperationException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 主观题业务接口类
 * @author Guqier
 * @version 1.0
 * @date 2023/7/20 16:11
 */
public interface SubjectItemService extends IService<SubjectItem> {
    boolean addSubjectItem(SubjectItemUpdateDto dto, Long currUserId);

    boolean modifySubjectItem(SubjectItemUpdateDto dto, Long currUserId) throws DatabaseOperationException;

    @Transactional
    boolean removeSubjectItem(List<Long> ids, Long currUserId) throws Exception;

    PageR<SubjectItemListResult> getSubjectItemListByPage(SubjectItemPageParam param);

    BatchImportResult<SubjectItemExcel> importSubjectItem(MultipartFile file, Long currUserId) throws IOException;

    @Transactional
    boolean confirmBatchClozeItem(String uuid, Long currUserId) throws DatabaseOperationException;

    void exportImportFailedSubjectItem(String uuid, HttpServletResponse response) throws Exception;

    void exportSubjectItem(SubjectItemPageParam param, HttpServletResponse response) throws IOException;

    List<SubjectItemListResult> getSubjectItemByIds(List<Long> ids);

    List<SubjectItemListResult> transferSubjectItemToListResult(List<SubjectItem> subjectItems);

    List<String> ansToStringList(SubjectItem subjectItem);

    SubjectItem getSubjectItemById(Long id);

    boolean removeSubjectById(Long id);
}
